are now forbidden. A run of cleanupTitles.php will fix up existing pages.
* (bug 12446) Permissions check fix for undelete link
* (bug 12451) AJAX title normalization tweaks
+* When a user creating a page is not allowed to either create the page nor edit
+ it, all applicable reasons are now shown.
== Parser changes in 1.12 ==
}
$permErrors = $this->mTitle->getUserPermissionsErrors('edit', $wgUser);
- if( !$this->mTitle->exists() )
- $permErrors += array_diff( $this->mTitle->getUserPermissionsErrors('create', $wgUser), $permErrors );
+ if( !$this->mTitle->exists() ) {
+ # We can't use array_diff here, because that considers ANY TWO
+ # ARRAYS TO BE EQUAL. Thanks, PHP.
+ $createErrors = $this->mTitle->getUserPermissionsErrors('create', $wgUser);
+ foreach( $createErrors as $error ) {
+ # in_array() actually *does* work as expected.
+ if( !in_array( $error, $permErrors ) ) {
+ $permErrors[] = $error;
+ }
+ }
+ }
# Ignore some permissions errors.
$remove = array();